package cn.itcast.hystrix;

import cn.itcast.entity.User;
import cn.itcast.feign.UserFeignClient;
import org.springframework.stereotype.Component;

/**
 * @Author: zhaojie
 * @Date: Created in 11:06 2018/7/25
 * @Description: feign对hystrix的支持
 * 默认为每一个方法添加此短路器 所有方法请求超时时会进入此方法
 */
@Component
public class HystrixClientFallback implements UserFeignClient {

    @Override
    public User get(Long id) {
        User s = new User();
        s.setId(id);
        return s;
    }
}
